home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / SpriteWorld 2.2 / SpriteWorld files / Headers / SpriteWorldUtils.h < prev    next >
Encoding:
Text File  |  1998-12-19  |  3.1 KB  |  159 lines  |  [TEXT/CWIE]

  1. ///--------------------------------------------------------------------------------------
  2. //    SpriteWorldUtils.h
  3. //
  4. //    Portions are copyright: © 1991-94 Tony Myles, All rights reserved worldwide.
  5. //
  6. //    Description:    constants, structures, and prototypes for sprite utilities
  7. ///--------------------------------------------------------------------------------------
  8.  
  9.  
  10. #ifndef __SPRITEWORLDUTILS__
  11. #define __SPRITEWORLDUTILS__
  12.  
  13. #ifndef __SWCOMMON__
  14. #include "SWCommonHeaders.h"
  15. #endif
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <QuickDraw.h>
  19. #endif
  20.  
  21. #ifndef __ICONS__
  22. #include <Icons.h>
  23. #endif
  24.  
  25. #ifndef __QDOFFSCREEN__
  26. #include <QDOffscreen.h>
  27. #endif
  28.  
  29. #ifndef __SPRITEWORLD__
  30. #include "SpriteWorld.h"
  31. #endif
  32.  
  33. #ifndef __SPRITELAYER__
  34. #include "SpriteLayer.h"
  35. #endif
  36.  
  37. #ifndef __SPRITE__
  38. #include "Sprite.h"
  39. #endif
  40.  
  41. #ifndef __SPRITEFRAME__
  42. #include "SpriteFrame.h"
  43. #endif
  44.  
  45.  
  46. enum
  47. {
  48.     kColorIconResType = 'cicn'
  49. };
  50.  
  51. #ifndef NewColorSearchProc
  52. #define NewColorSearchProc(x) (x)
  53. #endif
  54.  
  55. ///--------------------------------------------------------------------------------------
  56. //    sprite utilities function prototypes
  57. ///--------------------------------------------------------------------------------------
  58.  
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62.  
  63. #if PRAGMA_ALIGN_SUPPORTED
  64. #pragma options align=mac68k
  65. #endif
  66.  
  67.  
  68. SW_FUNC OSErr SWCreateRegionFromCIconMask(
  69.     RgnHandle *maskRgn,
  70.     CIconHandle cIconH);
  71.  
  72. SW_FUNC OSErr SWCreateRegionFromPict(
  73.     RgnHandle *pictRgnH,
  74.     PicHandle srcPictH);
  75.  
  76. SW_FUNC OSErr SWCreateRegionFromPictResource(
  77.     RgnHandle *pictRgnH,
  78.     short pictResID);
  79.  
  80. SW_FUNC OSErr SWGetCIcon(
  81.     CIconHandle* cIconH,
  82.     short iconResID);
  83.  
  84. SW_FUNC OSErr SWCreateRegionFromGWorldAndRect(
  85.     RgnHandle *maskRgn,
  86.     GWorldPtr maskGWorld,
  87.     Rect* frameRect);
  88.  
  89. SW_FUNC OSErr SWCreateRegionFromGWorldAndRectStart(
  90.     GWorldPtr *tempMaskGWorld,
  91.     short     maxWidth,
  92.     short     maxHeight);
  93.  
  94. SW_FUNC void SWCreateRegionFromGWorldAndRectFinish(
  95.     GWorldPtr tempMaskGWorld);
  96.  
  97. SW_FUNC OSErr SWCreateRegionFromGWorldAndRectPartial(
  98.     RgnHandle     *maskRgn,
  99.     GWorldPtr     maskGWorld,
  100.     GWorldPtr     tempMaskGWorld,
  101.     Rect*         frameRect);
  102.  
  103. SW_FUNC OSErr SWCreateGWorldFromPictResource(
  104.     SpriteWorldPtr destSpriteWorld,
  105.     GWorldPtr *pictGWorldP,
  106.     short pictResID);
  107.  
  108. SW_FUNC OSErr SWCreateGWorldFromPict(
  109.     SpriteWorldPtr destSpriteWorld,
  110.     GWorldPtr *pictGWorld,
  111.     PicHandle srcPictH);
  112.  
  113. SW_FUNC OSErr SWCreateGWorldFromCIconMask(
  114.     SpriteWorldPtr destSpriteWorld,
  115.     GWorldPtr *maskGWorldP,
  116.     CIconHandle cIconH);
  117.  
  118. SW_FUNC void SWSetTransparentColor(
  119.     const RGBColor *RGB);
  120.  
  121. SW_FUNC OSErr SWBlackenGWorld( 
  122.     GWorldPtr oldGWorld );
  123.  
  124. SW_FUNC OSErr SWWhitenGWorld(
  125.     GWorldPtr oldGWorld );
  126.  
  127. pascal Boolean blackenColorSearch( 
  128.     RGBColor *RGB, long *position );
  129.  
  130. pascal Boolean whitenColorSearch(
  131.     RGBColor *RGB, long *position );
  132.  
  133. SW_FUNC void SWClearStickyError(void);
  134.  
  135. SW_FUNC OSErr SWStickyError(void);
  136.     
  137. SW_FUNC void SWSetStickyIfError(
  138.     OSErr errNum);
  139.     
  140. SW_FUNC Boolean SWHasSystem7(void);
  141.  
  142. SW_FUNC OSErr SWGetProcessorType(short *processorType);
  143.  
  144. SW_FUNC short SW_ABS(short theNum);
  145.  
  146. void SWAssertFail(char* filename, int lineNum);
  147.  
  148. #if PRAGMA_ALIGN_SUPPORTED
  149. #pragma options align=reset
  150. #endif
  151.  
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155.  
  156.  
  157. #endif /* __SPRITEWORLDUTILS__ */
  158.  
  159.